home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / ny_src.zip / NYEDIT.H < prev    next >
C/C++ Source or Header  |  1997-04-22  |  7KB  |  230 lines

  1. //                        0 - Critical Door error (no fossil, etc.)
  2. //                        1 - Carrier lost, user off-line
  3. //                        2 - Sysop terminated call, user off-line
  4. //                        3 - User time used up, user STILL ON-LINE
  5. //                        4 - Keyboard inactivity timeout, user off-line
  6. //                       10 - User chose to return to BBS
  7. //                       11 - User chose to logoff, user off-line
  8. //                       12 - Critical RAVote error
  9.  
  10.  
  11. //#include <process.h>
  12. #include <math.h>
  13. //#include <dos.h>
  14. #include <dir.h>
  15. #include <string.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <time.h>
  19. #include <errno.h>
  20. //#include <ctype.h>
  21. #include <share.h>
  22. //#include <locking.h>
  23. #include <conio.h>
  24. #include <io.h>
  25. //#include <fcntl.h>
  26. //#include <sys\stat.h>
  27.  
  28. #include "\odoors\opendoor.h"                   // Must be included in all doors
  29.  
  30.  
  31. #define USER_FILENAME         "NY2008.USR"
  32. //#define ENEMY_FILENAME         "NY2008.ENM"
  33. //#define ENEMY_INDEX        "NY2008.ENI"
  34. #define MAX_USERS                 30000
  35. #define FILE_ACCESS_MAX_WAIT    40
  36. #define LEVELS            21
  37.  
  38.  
  39. //typedef enum                {HANDS,PEPPER,KNIFE,CHAIN,GUN,RIFLE,LASER_GUN,SHOTGUN,MACHINEGUN,GRANADE_LAUNCHER,BLASTER,A_BOMB} weapon;
  40. typedef enum {HANDS,
  41.           PEPPER,
  42.           KNIFE,
  43.           CHAIN,
  44.           GUN,
  45.           RIFLE,
  46.           LASER_GUN,
  47.           SHOTGUN,
  48.           MACHINEGUN,
  49.           GRANADE_LAUNCHER,
  50.           BLASTER,
  51.           A_BOMB,
  52.           SHARP_STICK,
  53.           SCREWDRIVER,
  54.           HAMMER,
  55.           LEAD_PIPE,
  56.           COLT,
  57.           ELEPHANT_GUN,
  58.           NAILGUN,
  59.           ASSAULT_RIFLE,
  60.           PROTON_GUN,
  61.           NEUTRON_PHASER,
  62.           ULTRASOUND_GUN} weapon;
  63.  
  64. /*long     gun_price[A_BOMB+1]={0,    50,    100,  200,  500,1000, 2000,     5000,   10000,     20000,           50000,  250000};
  65. */
  66. typedef enum                 {POT,HASH,LSD,COKE,PCP,HEROIN} drug_type;
  67. /*int     drug_price[HEROIN+1]={10, 25,  50, 100, 150,200};
  68. */
  69. typedef enum {MALE,FEMALE} sex_type;
  70. typedef enum {HEADBANGER,HIPPIE,BIG_FAT_DUDE,CRACK_ADDICT,PUNK} guy_type;
  71. typedef enum {NONE,CRAPS,HERPES,SYPHILIS,AIDS} desease;
  72. typedef enum {ALIVE,UNCONCIOUS,DEAD} guy_status;
  73. typedef enum {NOWHERE,MOTEL,REG_HOTEL,EXP_HOTEL} hotel_type;
  74.  
  75. int        main(int argc,char *argv[]);    // Function prototype declarations
  76.  
  77. char       entry_menu(void);               // Menu draw...
  78. void    DisplayStats(void);
  79. void    print_drug(drug_type drug);
  80. void    print_arm(weapon arm);
  81. void    ny_kernel(void);
  82. void    print_disease(desease ill);
  83.  
  84. void WaitForEnter(void);
  85. void WriteCurrentUser(int user_num);
  86. //FILE *ExculsiveFileOpen(char *pszFileName, char *pszMode);
  87. void CustomConfigFunction(char *pszKeyword, char *pszOptions);
  88. void strzcpy(char dest[],const char src[], int beg,int end);
  89. void    cap_names(char name[]);
  90. void    dump(void);
  91. void    ny_disp_emu(char line[]);
  92. void    get_bbsname(char bbsname[]);
  93. int    seereg(char bbsname[]);
  94. FILE *ShareFileOpen(char *pszFileName, char *pszMode);
  95. size_t ny_fread(const void *ptr, size_t size, size_t n, FILE*stream);
  96. size_t ny_fwrite(const void *ptr, size_t size, size_t n, FILE*stream);
  97. //void ChangeOnlineRanks(void);
  98. void SortScrFile(int usr);
  99. void SortScrFileB(int usr);
  100. void ch_game_d(void);
  101. void ch_flag_d(void);
  102. void set_points(unsigned long raise);
  103.  
  104.  
  105.  
  106.  
  107. /*typedef struct {
  108.     int        first_enemy[LEVELS],
  109.             last_enemy[LEVELS];
  110.     } enemy_idx;*/
  111.  
  112. //Player User File structure (beta6+)
  113. typedef struct {
  114.     //character files
  115.     char        bbsname[36],     //the BBS name of the user
  116.             name[25],        //the name of the character
  117.             say_win[41],     //what the user says when he wins
  118.             say_loose[41];   // "    "    "   "    "   "  looses
  119.     //integer records
  120.     int        rank,             //user rank
  121.             days_not_on,     //days the user has been inactive
  122.             strength,        //attacking strenght of the user
  123.             defense,         //defensive strenght
  124.             condoms,         //condoms user has
  125.             since_got_laid,  //days since the user last got laid
  126.             drug_hits,       //the hist that the user has
  127.             drug_days_since; //if addicted how long the user
  128.                      //has not used the drug
  129.  
  130.     //long type records
  131.     long        hitpoints,       //users hitpoints
  132.             maxhitpoints;    //maximum of the users hitpoints
  133.  
  134.     //unsigned long type record
  135.     unsigned long   points,          //users points
  136.             money,           //money in hand
  137.             bank;            //money in bank
  138.  
  139.     //unsigned char type records used as values
  140.     unsigned char    level,           //user level
  141.             turns,           //fight the user has left today
  142.             hunger,          // % of hunger
  143.             sex_today,       //sex turns left today
  144.             std_percent,     // % of current std
  145.             drug_addiction,  // % of drug addiction
  146.             drug_high,       // % of how "high" the player is
  147.             hotel_paid_fer,  //for how many more days the hotel
  148.                      //is paid for
  149.             days_in_hospital;//how many days has the use been
  150.                      //in hospital
  151.  
  152.     /*enumerated types stored as char!!! (not int)*/
  153.     guy_status    alive;           //user: alive, unconsious, or dead
  154.     sex_type    sex;             //user sex: Male, Female
  155.     guy_type    nation;          //what is he:
  156.                      //punk, headbanger ...
  157.     weapon        arm;             //players weapon
  158.     desease        std;         //current player std
  159.     drug_type    drug;            //current player drug type
  160.     hotel_type    rest_where;      //where the user is staying lately
  161.  
  162.     /*added values BETA 9*/
  163.     char        wtc;         //# of wtc bombings allowed per day
  164.                      //default=1
  165.     char        poison;         //number of poisoning of watr allowed
  166.                      //per day, default=1
  167.  
  168.     /*added values v0.10*/
  169.     unsigned char   rocks,           //Rocks, usable in fights
  170.             throwing_ability,//Throwing ability 0-100
  171.             punch_ability,   //Punching ability 0-100
  172.             kick_ability;    //Kicking ability 0-100
  173.  
  174. /*reserved for future use 4 bytes reset to 0*/
  175.     int        res1,
  176.             res2;
  177.     } user_rec;
  178.  
  179.  
  180. /*typedef struct {
  181.     char        bbsname[36],
  182.             name[25];
  183.     guy_type    nation;
  184.     int        level,
  185.             rank;
  186.     unsigned long   points,
  187.             money,
  188.             bank;
  189.     guy_status    alive;
  190.     int        days_not_on;
  191.     sex_type    sex;
  192.     char        say_win[41],
  193.             say_loose[41];
  194.     int        turns,
  195.             hunger,
  196.             strength,
  197.             defense;
  198.     long        hitpoints,
  199.             maxhitpoints;
  200.     weapon        arm;
  201.     int        condoms;
  202.     int        since_got_laid;
  203.     int        sex_today;
  204.     desease        std;
  205.     int        std_percent;
  206.     drug_type    drug;
  207.     int        drug_hits,
  208.             drug_addiction,
  209.             drug_high,
  210.             drug_days_since;
  211.     hotel_type    rest_where;
  212.     unsigned char    hotel_paid_fer,
  213.             days_in_hospital;
  214.     } user_rec;*/
  215.  
  216. typedef struct {
  217.     char        name[25];
  218.     guy_type    nation;
  219.     char        n1;
  220.     int        level;
  221.     unsigned long   points;
  222.     guy_status    alive;
  223.     char        n2;
  224.     sex_type    sex;
  225.     char        n3;
  226.     int        user_num,
  227.             online;
  228.     } scr_rec;
  229.  
  230.